<template>
	<view class="pages-demo-index">
		<view>{{ text }}</view>
		<view>时间戳：{{ timestamp }}</view>
		<view>当前时间:{{ timeString }}</view>
		<button type="default" @click="updateTime">刷新当前时间</button>
	</view>
</template>

<script>
	import { mapState, mapGetters, mapMutations } from 'vuex'
	export default {
		data() {
			return {
			}
		},
		computed: {
			...mapState({
				text: state => state.timer.text,
				timestamp: state => state.timer.timestamp
			}),
			...mapGetters([
				'timeString'
			])
		},
		onLoad() {

		},
		methods: {
			...mapMutations(['updateTime'])
		}
	}
</script>

<style lang="scss" scoped>
	.pages-demo-index {
		background-color: #FFFFFF;
	}
</style>
